/*
 * Criado em Mar 21, 2005
 *
 *
 */
package vendas.dto;

import gminet.infra.dao.SimpleTransferObject;

import java.util.List;

/**
 * @author Gabriel Flores Mendes
 * 
 * 
 */
public class PaymentStatus extends SimpleTransferObject {

    private static final long serialVersionUID = 766649985648603063L;

    private static final byte UNDEFINED_ID = 0;
    private static final byte PAY_ID = 10;
    private static final byte UNPAY_ID = 20;

    public static final PaymentStatus UNDEFINED = new PaymentStatus(UNDEFINED_ID, "INDEFINIDO");
    public static final PaymentStatus PAY = new PaymentStatus(PAY_ID, "Pago");
    public static final PaymentStatus UNPAY = new PaymentStatus(UNPAY_ID, "A pagar");

    static {
        Class<PaymentStatus> clazz = PaymentStatus.class;
        addObject(clazz, PAY);
        addObject(clazz, UNPAY);
    }

    private PaymentStatus(int i, String str) {

        super(i, str);
    }
    
    public boolean isPayed() {

        return getId() == PAY_ID;
    }

    public boolean isUnpayed() {

        return getId() == UNPAY_ID;
    }

    @SuppressWarnings("unchecked")
    public static List<PaymentStatus> getList() {

        return (List<PaymentStatus>) getList(PaymentStatus.class);
    }

    public static PaymentStatus getPaymentStatusById(int statusId) {

        return (PaymentStatus) getObject(PaymentStatus.class, statusId);
    }

}
